In today's digital world, where virtually any application may be implemented via digital electronic circuits, it is imperative to be able to efficiently design, test and diagnose software code prior to commercial implementation. It is also important to be able to efficiently diagnose and debug existing systems which are malfunctioning. Accordingly, it is known to monitor program code loaded in memory as it is being accessed and executed. This is preferably done by monitoring the signals present on the address lines (i.e., bus) or data lines connected to the memory being monitored. The data collected from monitoring the memory accesses can be grouped into two main categories:
1.) trace data; and PA1 2.) code coverage data. PA1 1.) allows for real-time code coverage (i.e., information regarding memory accesses); PA1 2.) allows for the use of a separate code coverage memory where code coverage data is stored in real-time; PA1 3.) allows for the tracing of execution paths of tested programs by storing user defined, multiple-bit patterns into the code coverage memory; PA1 4.) allows for real-time trace; PA1 5.) allows for fine trace control using the code coverage memory; PA1 6.) performs all of the above functions in conjunction with an emulated circuit, where an emulated ROM is monitored according to the present invention; PA1 7.) allows for code coverage read and trace data dump for further processing by a host computer; and PA1 8.) allows for the collection of informative code coverage and trace data in real-time for efficient design, testing, and diagnosis of digital systems and program code.
Trace data relates to information regarding the actual data present on the address lines and/or control lines, and/or data lines at any given point of program code access and execution. Trace data allows a "snap shot" of the signals present on the buses of the monitored system at any given point in time. By examining the trace data, the developer or tester may determine whether the system is providing the right signals on the buses at any given time.
Code coverage data relates to information summarizing the accesses to the monitored memory during program execution. Code coverage data allows developers and testers to determine which sections and locations of the memory (e.g., Read Only Memory, "ROM") are being accessed during program execution.
Known systems for obtaining trace data or code coverage data do not allow for the real-time collection of test data that provides information on test program execution paths. For example, see U.S. Pat. No. 5,321,828 which describes an in-circuit emulator designed to detect function calls to create a histogram and code coverage profile from that data. See U.S. Pat. No. 4,674,089 which describes a silicon based debugging system. Additionally, many of the code coverage methods are software based, often requiring special software "branch analysis" coding. For example, see U.S. Pat. No. 4,914,659 where the test code itself is specially coded with branch analysis code for the purpose of obtaining test data. These systems do not allow for the real-time collection of code coverage and trace data that allows use of user-defined, multi-bit, code coverage data.
Known diagnostic systems have, for example, been implemented with emulation circuits for testing program code loaded in an emulated ROM memory. Such ROM emulators have particular applicability in embedded controller systems (e.g., a microwave controller) where program code is loaded in ROM memory. When these embedded systems malfunction, they may be diagnosed by placing an emulated ROM chip into the ROM socket of the embedded "target" system and running tests through the emulated ROM. The emulated ROM, usually random access memory (RAM), may be loaded with program (test) data from a host computer system. Trace data and code coverage may be obtained from the running of the test program to determine problems in the target system. The efficiency of these emulation/diagnosis systems greatly reduce the cost of producing program code, hardware systems, and diagnosing malfunctioning existing systems. Although code coverage, per se, is not a new innovation, real-time code coverage, where memory access data is collected in a memory chip in real-time and where the code coverage data provides rich execution path information, would be an advancement in the art. The present invention allows the tracing of code execution paths by storing a user-defined, multi-bit pattern into a "code coverage " memory. The code coverage data is collected in real-time and stored for further analysis and processing. By using multiple bit code coverage data, the user may vary the bit patterns of the code coverage data for different test runs to "paint" different execution paths in the code coverage memory.
The present invention also provides for real-time trace of a monitored memory (e.g., an emulated memory) for analyzing bus activity. In the preferred embodiment of the present invention, the address lines of the emulation circuit are used as inputs to both the code coverage memory and trace memory.
Another feature of the present invention is that the code coverage memory (i.e., memory used to store code coverage data) may alternatively be used for fine trace control. In other words, in the "fine trace mode", fine trace data stored in the code coverage memory is read (as opposed to being written as in the "code coverage mode") upon which a fine trace control circuit processes the retrieved fine trace data to control tracing functions.
Accordingly, the present invention provides a versatile diagnostic system that, unlike known systems: